﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlDoiChieuTonKhoThucTe.ascx.cs" Inherits="WebUserControl" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<%@ Register src="uscMsgBox.ascx" tagname="uscMsgBox" tagprefix="uc1" %>
<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/datePicker.css")%>' type="text/css" />
<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/K_BaoCaoFormLayout.css")%>' type="text/css" />

<script type="text/javascript">
     function pageLoad() {
     
      $(function()
        {
	            $("#<%= TextBox1.ClientID %>").datePicker(
	                {
	                    clickInput:true,
			            startDate: '01/01/1970'
	                }
	                );
        });
        
      $("#<%= Button4.ClientID %>").click(function() { 
       if ($("#<%= TextBox1.ClientID %>").val().length>0)
        {
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } });
        } 
        }); 
       $("#<%= Button5.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        }); 
          $("#<%= Button3.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        });  
        $("#<%= Button6.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        });  
        $("#<%= Button1.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        });  
        $("#<%= Button2.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        });  
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
                function EndRequestHandler(sender, args) {
                        $.unblockUI();
                }
        }  
   
</script> 

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:MultiView ID="MultiView1" runat="server">
            <asp:View ID="View1" runat="server">
            <fieldset>
    <legend>Đối chiếu tồn kho thực tế</legend>
    <div class="fm-req">
      <label for="DropDownList1">Chọn kho:</label>
      <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
                        DataSourceID="SqlDataSource1" DataTextField="description" 
                        DataValueField="location" Width="200px">
                    </asp:DropDownList>
      </div>
      <div class="fm-req">
      <label for="TextBox1">Ngày IRA:</label>
      <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
      <asp:RequiredFieldValidator ControlToValidate="TextBox1" ID="R1" Display="None" runat="server" 
                        ErrorMessage="Phải chọn thời gian">
                        </asp:RequiredFieldValidator>
                    <cc1:ValidatorCalloutExtender ID="RequiredFieldValidator1_ValidatorCalloutExtender" 
                        runat="server" TargetControlID="R1">
                    </cc1:ValidatorCalloutExtender>
      </div>
      </fieldset>
      <div>
       <asp:Button ID="Button4" runat="server" onclick="Button4_Click" Text="Tiếp tục" />
      </div>
            
            </asp:View>
            <asp:View ID="View2" runat="server">
            
                    <div>
                                <asp:Button ID="Button5" runat="server" onclick="Button5_Click" 
                                    Text="Quay về" />
                                &nbsp;&nbsp;
                                <asp:Button ID="Button3" runat="server" onclick="Button3_Click" 
                                    Text="In báo cáo" />
                               </div>
            </asp:View>
            <asp:View ID="View3" runat="server">
                    <div>
                            <asp:Button ID="Button6" runat="server" onclick="Button6_Click" 
                                Text="Quay về" />
                            &nbsp;&nbsp;
                            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
                                Text="Nhập IRA" />
                            &nbsp;&nbsp;
                            <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="Lưu" 
                                Width="100px" />
                            &nbsp;
                       </div>
                       <br />
                     <asp:Panel HorizontalAlign="Center" ScrollBars="Vertical" Height="500" Width="500" ID="Panel1" runat="server" BackColor="#99CCFF" BorderStyle="Solid">
                     
                            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                            CellPadding="4" ForeColor="#333333" GridLines="None" 
                             Width="440px" Height="180px">
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <RowStyle BackColor="#EFF3FB" />
                            <Columns>
                                <asp:TemplateField HeaderText="Stt">
                                    <ItemTemplate>
                                        
                                        <asp:Label ID="Label1" runat="server" Text="<%#Container.DataItemIndex + 1%>"></asp:Label>
                                    </ItemTemplate>
                                    <HeaderTemplate>
                                        Stt
                                    </HeaderTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="itemkey" HeaderText="Mã hàng" />
                                <asp:BoundField DataField="description" HeaderText="Tên hàng" />
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:TextBox ID="TextBox2" runat="server">
                                        </asp:TextBox>
                                        <cc1:FilteredTextBoxExtender FilterType="Numbers" TargetControlID="TextBox2" ID="FilteredTextBoxExtender1" runat="server">
                                        </cc1:FilteredTextBoxExtender>
                                    </ItemTemplate>
                                    <HeaderTemplate>
                                        Số lượng
                                    </HeaderTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#2461BF" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                        
                        </asp:Panel>      
                        
            </asp:View>
        </asp:MultiView>
        
        <br />
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="Data Source=SMART-7DC519368\SQLEXPRESS;Initial Catalog=CosmeticCenter;Integrated Security=True" 
            ProviderName="System.Data.SqlClient" SelectCommand="GET_MAKHO_THEO_SITECODE" 
            SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:Parameter Name="sitecode" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <uc1:uscMsgBox ID="uscMsgBox1" runat="server" />
       
    </ContentTemplate>
</asp:UpdatePanel>
